<!--
 * @Author: ShiJunJie
 * @Date: 2020-12-04 14:32:21
 * @LastEditors: ShiJunJie
 * @LastEditTime: 2021-09-07 16:41:15
 * @Descripttion: svg图标  <SvgIcon icon="name&type(svg||iconfont)" />
-->
<template>
  <template v-if="name">
    <span class="anticon SvgIcon">
      <svg class="svg-icon" aria-hidden="true">
        <use :xlink:href="`#icon-${name}`"></use>
      </svg>
    </span>
  </template>
</template>
<script>
  export default {
    name: 'SvgIcon',
    props: {
      name: {
        type: String,
        required: true
      }
    }
  }
</script>

<style>
  .svg-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
  }
</style>
